package com.pixiv.controller;


import com.pixiv.Entity.User;
import com.pixiv.service.AdvertisingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Controller
@RequestMapping("advertis")
public class AdvertisingController {


    @Autowired
    private AdvertisingService advertisingService;

    @RequestMapping("get")
    public void getAdvertis(HttpServletRequest req, HttpServletResponse resp)
    {
        String path = advertisingService.getAdversitingPath(0);
        User.outPutPictureStream(resp,"/title/context/" + path,null,null);

    }

    @ResponseBody
    @RequestMapping("upAduitPicture")
    public void upAduitPicture(HttpServletRequest req, HttpServletResponse resp)
    {

    }

}
